﻿using System;
using System.Data;
using System.Collections.Generic;
using System.Data.SqlClient;
using EMS20.Entity;
using EMS20.IDataAccessLayer;
using EMS20.DALFactory;

namespace EMS20.BusinessLogicLayer
{
    /// <summary>
    /// BLL Layer For dbo.feedback.
    /// </summary>
    public class feedbackBLLBase
    {
		#region ----------变量定义----------
		///<summary>
		///
		///</summary>
		public static readonly IfeedbackDataAccessLayer _dal=DataAccessFactory.Create_feedback();
		#endregion
		
		#region ----------构造函数----------
		/// <summary>
		/// 构造函数
		/// </summary>
		public feedbackBLLBase()
		{
		}
		#endregion

        #region ----------函数定义----------
		#region 添加更新删除
		/// <summary>
		/// 向数据库中插入一条新记录。
		/// </summary>
		/// <param name="ofeedbackInfo">feedback??</param>
		/// <returns>新插入记录的编号</returns>
		public static int Create_feedbackInsert(feedbackEntity ofeedbackInfo)
		{
			// Validate input
			if (ofeedbackInfo == null)
				return 0;
			// Use the dal to insert a new record 
			return _dal.Create_feedbackInsert(ofeedbackInfo);
		}
		/// <summary>
		/// 向数据库中插入一条新记录。带事务
		/// </summary>
		/// <param name="sp">事务对象</param>
		/// <param name="ofeedbackInfo">feedback实体</param>
		/// <returns>新插入记录的编号</returns>
		public static int Create_feedbackInsert(SqlTransaction sp,feedbackEntity ofeedbackInfo)
		{
			if (ofeedbackInfo == null)
				return 0;
			// Use the dal to insert a new record 
			return _dal.Create_feedbackInsert(sp,ofeedbackInfo);
		}
		/// <summary>
		/// 向数据表feedback更新一条记录。
		/// </summary>
		/// <param name="ofeedbackInfo">ofeedbackInfo</param>
		/// <returns>影响的行数</returns>
		public  static void Create_feedbackUpdate(feedbackEntity ofeedbackInfo)
		{
            // Validate input
			if (ofeedbackInfo==null)
				return;
			// Use the dal to update a new record 
			_dal.Create_feedbackUpdate(ofeedbackInfo);
		}
		/// <summary>
		/// 向数据表feedback更新一条记录。带事务
		/// </summary>
		/// <param name="sp">事务对象</param>
		/// <param name="ofeedbackInfo">ofeedbackInfo</param>
		/// <returns>影响的行数</returns>
		public static int Create_feedbackUpdate(SqlTransaction sp,feedbackEntity ofeedbackInfo)
		{
			// Validate input
			if (ofeedbackInfo==null)
				return 0;
			// Use the dal to update a new record 
			return _dal.Create_feedbackUpdate(sp,ofeedbackInfo);
		}
		
		/// <summary>
		/// 删除数据表feedback中的一条记录
		/// </summary>
	    /// <param name="f_id">f_id</param>
		/// <returns>影响的行数</returns>
		public static int Create_feedbackDelete(int f_id)
		{
			// Validate input
			if(f_id<0)
				return 0;
			return _dal.Create_feedbackDelete(f_id);
		}
		/// <summary>
		/// 删除数据表feedback中的一条记录,带事务
		/// </summary>
		/// <param name="sp">事务对象</param>
	    /// <param name="f_id">f_id</param>
		/// <returns>影响的行数</returns>
		public static int Create_feedbackDelete(SqlTransaction sp,int f_id)
		{
			// Validate input
			if(f_id<0)
				return 0;
			return _dal.Create_feedbackDelete(sp,f_id);
		}
		#endregion
		
        /// <summary>
		/// 得到 feedback 数据实体
		/// </summary>
		/// <param name="f_id">f_id</param>
		/// <returns>feedback 数据实体</returns>
		public static feedbackEntity Get_feedbackEntity(int f_id)
		{
			// Validate input
			if(f_id<0)
				return null;

			// Use the dal to get a record 
			return _dal.Get_feedbackEntity(f_id);
		}
		
		/// <summary>
		/// 得到数据表feedback所有记录
		/// </summary>
		/// <returns>实体集</returns>
		public static IList< feedbackEntity> Get_feedbackAll()
		{
			// Use the dal to get all records 
			return _dal.Get_feedbackAll();
		}
			
		
		/// <summary>
        /// 检测是否存在根据主键
        /// </summary>
        /// <param name="f_id">f_id</param>
        /// <returns>是/否</returns>
		public static bool IsExistfeedback(int f_id)
		{
			return _dal.IsExistfeedback(f_id);
		}

        #endregion
		
		
    }
}

